#markdown {
  color: #657487;
  word-wrap: break-word;
  clear: both;

  h1 {
    position: relative;
    margin: 20px 0;
    color: #8492a6;
    text-align: center;
    transition: .25s;

    a {
      display: none;
    }

    &:hover {
      cursor: pointer;
      color: @primary-color;
    }
  }

  h2, h3, h4, h5, h6 {
    position: relative;
    margin: 20px 0 32px 0;
    width: fit-content;
    max-width: 100%;
    color: #8492a6;
    transition: .25s;

    a {
      display: none;
    }

    &::before {
      content: '';
      position: absolute;
      left: 0;
      bottom: -8px;
      display: block;
      width: 30px;
      height: 3px;
      background: linear-gradient(lighten(@primary-color, 20%) 30%, @primary-color 70%);
      box-shadow: 0 3px 3px fade(@primary-color, 40%);
      border-radius: 4px;
      transition: .25s;
      z-index: 1;
    }

    &:hover {
      cursor: pointer;
      color: @primary-color;

      &::before {
        width: 100%;
      }
    }
  }

  p {
    img {
      max-width: 100%;
      border-radius: 4px;
    }
  }

  ul,
  ol {
    li {
      p {
        margin-top: 20px;
      }
    }
  }

  a {
    text-shadow: 0 1px 2px darken(@link-color, 1%);

    svg {
      &.icon.outbound {
        left: 3px;
        color: @primary-color;
      }
    }
  }

  blockquote {
    margin: 16px 0;
    padding: 20px;
    background-color: #fafafa;
    border-left: 6px solid #e6e6e6;
    word-break: break-word;
    font-size: 16px;
    font-weight: normal;
    line-height: 30px;

    p {
      margin-bottom: 0;
      word-break: break-word;
    }
  }

  strong {
    padding: 0 2px;
    font-weight: bold;
  }

  code {
    margin-left: 2px;
    margin-right: 2px;
    padding: 2px 4px;
    color: @primary-color;
    background-color: @primary-color-1;
    border: 1px solid @primary-color-3;
    border-radius: 4px;
    white-space: normal;
  }

  div[class*="language-"] {
    position: relative;
    background-color: #282c34;
    border-radius: 4px;

    .highlight-lines {
      position: absolute;
      top: 0;
      left: 0;
      padding-top: 32px;
      width: 100%;
      user-select: none;
      line-height: 1.4;

      .highlighted {
        background-color: rgba(0, 0, 0, .66);
      }
    }

    pre,
    pre[class*="language-"] {
      position: relative;
      padding: 30px 25px 20px 25px;
      border-radius: 4px;
      white-space: pre;
      word-spacing: normal;
      word-break: normal;
      word-wrap: normal;
      tab-size: 4;
      background-color: transparent;
      line-height: 1.4;
      overflow: auto;

      code {
        position: relative;
        padding: 0;
        background-color: transparent;
        color: #ffffff;
        border-radius: 0;
        border: none;
        white-space: unset;
      }
    }

    &.line-numbers-mode {
      pre {
        padding-left: 48px;
      }

      .line-numbers-wrapper {
        position: absolute;
        top: 18px;
        padding: 12px 0;
        width: 36px;
        text-align: center;
        color: hsla(0, 0%, 100%, .3);
        line-height: 1.4;
        z-index: 2;

        &::after {
          content: "";
          position: absolute;
          top: -6px;
          left: 13px;
          width: 10px;
          height: 10px;
          line-height: 10px;
          border-radius: 50%;
          background-color: rgba(0, 0, 0, .25);
          font-size: 10px;
          text-align: center;
          cursor: pointer;
          box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
          animation: breath 2.3s ease-in-out infinite alternate;
        }
      }

      &::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 36px;
        height: 100%;
        border-right: 1px solid rgba(0, 0, 0, .66);
        background-color: #282c34;
        border-radius: 4px 0 0 4px;
      }
    }

    &::before {
      content: "";
      position: absolute;
      top: 8px;
      right: 10px;
      font-size: 8px;
      color: hsla(0, 0%, 100%, .4);
    }
  }

  each(@codeLang, {
    div[class*="language-@{value}"]::before {
      content: "@{value}";
    }
  });

  hr {
    position: relative;
    width: 100%;
    height: 2px;
    background-color: #eff2f7;
    border: none;
    overflow: hidden;

    &::before {
      position: absolute;
      content: '';
      top: -2px;
      width: 64px;
      height: 4px;
      background: linear-gradient(90deg, fade(@primary-color, 0) 0, @primary-color);
      transform: translateX(-64px);
      animation: hrLine 4s ease-in-out 0s infinite;
    }
  }

  table {
    margin: 20px 0;
    display: block;
    overflow-x: auto;
    border-radius: 4px;

    thead {
      tr {
        th {
          padding: 16px;
          background-color: #fafafa;
          color: rgba(0, 0, 0, .85);
          font-weight: 500;
          border-bottom: 1px solid #e8e8e8;
        }
      }
    }

    tbody {
      tr {
        transition: all 0.3s, height 0s;

        td {
          padding: 16px;
          border-bottom: 1px solid #e8e8e8;
        }

        &:hover {
          background-color: @primary-color-1;
        }
      }
    }
  }

  .table-of-contents {
    display: none;

    ul {
      li {
      }

      &:first-child {
        margin-top: 16px;
      }
    }
  }

  .custom-block {
    position: relative;
    margin: 28px 0 16px 0;
    padding: 10px 20px;
    width: fit-content;
    max-width: 100%;
    border-radius: 10px;
    color: #ffffff;

    ul,
    ol {
      margin-bottom: 0;
    }

    p {
      position: relative;
      line-height: 1.9;
      margin: 5px 0;
      font-size: 16px;
    }

    a {
      font-weight: 600;
      color: #ffffff;
      text-shadow: 0 1px 2px darken(#ffffff, 1%);

      svg {
        &.icon.outbound {
          left: 3px;
          color: #ffffff;
        }
      }
    }

    .custom-block-title {
      font-weight: 600;
    }

    &::before {
      position: absolute;
      width: 24px;
      height: 24px;
      line-height: 24px;
      top: -12px;
      left: -12px;
      text-align: center;
      font-weight: 900;
      font-size: 12px;
      border-radius: 50%;
      box-shadow: 0 0 0 2.5px #ffffff;
      color: #ffffff;
    }

    &.primary,
    &.primaryLong {
      text-shadow: 0 -1px @primary-color;
      box-shadow: 0 1px 5px darken(@primary-color, 2%), 0 0 2px darken(@primary-color, 1%);
      background: linear-gradient(90deg, @primary-color, lighten(@primary-color, 10%));
    }

    &.primaryLong {
      width: 100%;
    }

    &.success,
    &.successLong {
      text-shadow: 0 -1px @success-color;
      box-shadow: 0 1px 5px darken(@success-color, 2%), 0 0 2px darken(@success-color, 1%);
      background: linear-gradient(90deg, @success-color, lighten(@success-color, 10%));

      &::before {
        content: "√";
        text-shadow: 0 -1px @success-color;
        background: linear-gradient(0deg, @success-color, lighten(@success-color, 10%));
      }
    }

    &.successLong {
      width: 100%;
    }

    &.tip,
    &.tipLong {
      text-shadow: 0 -1px @tip-color;
      box-shadow: 0 1px 5px darken(@tip-color, 2%), 0 0 2px darken(@tip-color, 1%);
      background: linear-gradient(90deg, @tip-color, lighten(@tip-color, 10%));

      &::before {
        content: "i";
        text-shadow: 0 -1px @tip-color;
        background: linear-gradient(0deg, @tip-color, lighten(@tip-color, 10%));
      }
    }

    &.tipLong {
      width: 100%;
    }

    &.warning,
    &.warningLong {
      text-shadow: 0 -1px @warning-color;
      box-shadow: 0 1px 5px darken(@warning-color, 2%), 0 0 2px darken(@warning-color, 1%);
      background: linear-gradient(90deg, @warning-color, lighten(@warning-color, 10%));

      &::before {
        content: "!";
        text-shadow: 0 -1px @warning-color;
        background: linear-gradient(0deg, @warning-color, lighten(@warning-color, 10%));
      }
    }

    &.warningLong {
      width: 100%;
    }

    &.error,
    &.errorLong {
      text-shadow: 0 -1px @error-color;
      box-shadow: 0 1px 5px darken(@error-color, 2%), 0 0 2px darken(@error-color, 1%);
      background: linear-gradient(90deg, @error-color, lighten(@error-color, 10%));

      &::before {
        content: "X";
        text-shadow: 0 -1px @error-color;
        background: linear-gradient(0deg, @error-color, lighten(@error-color, 10%));
      }
    }

    &.errorLong {
      width: 100%;
    }
  }

  /**
   * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
   * Based on https://github.com/chriskempson/tomorrow-theme
   * Begin
   */

  code[class*="language-"],
  pre[class*="language-"] {
    color: #ccc;
    background: none;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 1em;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    line-height: 1.5;
    tab-size: 4;
    hyphens: none;
  }

  pre[class*="language-"] {
    padding: 1em;
    margin: .5em 0;
    overflow: auto;
  }

  :not(pre) > code[class*="language-"],
  pre[class*="language-"] {
    background: #2d2d2d;
  }

  :not(pre) > code[class*="language-"] {
    padding: .1em;
    border-radius: .3em;
    white-space: normal;
  }

  .token.comment,
  .token.block-comment,
  .token.prolog,
  .token.doctype,
  .token.cdata {
    color: #999;
  }

  .token.punctuation {
    color: #ccc;
  }

  .token.tag,
  .token.attr-name,
  .token.namespace,
  .token.deleted {
    color: #e2777a;
  }

  .token.function-name {
    color: #6196cc;
  }

  .token.boolean,
  .token.number,
  .token.function {
    color: #f08d49;
  }

  .token.property,
  .token.class-name,
  .token.constant,
  .token.symbol {
    color: #f8c555;
  }

  .token.selector,
  .token.important,
  .token.atrule,
  .token.keyword,
  .token.builtin {
    color: #cc99cd;
  }

  .token.string,
  .token.char,
  .token.attr-value,
  .token.regex,
  .token.variable {
    color: #7ec699;
  }

  .token.operator,
  .token.entity,
  .token.url {
    color: #67cdcc;
  }

  .token.important,
  .token.bold {
    font-weight: bold;
  }

  .token.italic {
    font-style: italic;
  }

  .token.entity {
    cursor: help;
  }

  .token.inserted {
    color: green;
  }

  /**
   * End
   */
}

body.dark {
  #markdown {
    color: @dark-text-color;

    h2, h3, h4, h5, h6 {
      &::before {
        background: linear-gradient(lighten(@primary-color, 10%) 30%, @primary-color 70%);
        box-shadow: 0 3px 3px @dark-bg-color;
      }
    }

    blockquote {
      background-color: @dark-text-color-10;
      border-left-color: @dark-text-color-9;
    }

    code {
      color: @dark-text-color;
      background-color: @dark-text-color-10;
      border-color: @dark-text-color-9;
    }

    div[class*="language-"] {
      background-color: @dark-text-color-10;

      .highlight-lines {
        .highlighted {
          background-color: @dark-text-color-9;
        }
      }

      pre,
      pre[class*="language-"] {
        code {
          color: @dark-text-color;
        }
      }

      &.line-numbers-mode {
        &::after {
          background-color: @dark-text-color-10;
          border-right-color: @dark-text-color-9;
        }
      }
    }

    hr {
      background-color: @dark-text-color-10;
    }

    table {
      thead {
        tr {
          th {
            color: @dark-text-color;
            background-color: @dark-text-color-10;
            border-bottom-color: @dark-text-color-8;
          }
        }
      }

      tbody {
        tr {
          td {
            border-bottom-color: @dark-text-color-9;
          }

          &:hover {
            background-color: @dark-text-color-10;
          }
        }
      }
    }

    .custom-block {
      color: @dark-text-color-5;

      a {
        color: @dark-text-color-5;
        text-shadow: 0 1px 2px @dark-text-color;

        svg {
          &.icon.outbound {
            color: @dark-text-color-5;
          }
        }
      }

      &::before {
        box-shadow: 0 0 0 2.5px @dark-bg-color;
        color: @dark-bg-color;
      }
    }
  }
}

@media (max-width: 767px) {
  #markdown {
    .table-of-contents {
      display: block;
    }
  }
}
